package com.business.systemmanage.controller;


import com.business.systemmanage.common.entity.ResponseInfo;
import com.business.systemmanage.service.IItemClassService;
import com.business.systemmanage.vo.ItemClassVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 菜品分类 前端控制器
 * </p>
 *
 * @author sixDog
 * @since 2019-04-12
 */
@RestController
@RequestMapping("/systemmanage/itemClass")
public class ItemClassController {
    @Autowired
    private IItemClassService iItemClassService;
    @ApiOperation(
            value = "保存菜品类别",
            tags = {"菜品类别"})
    @RequestMapping("/insert")
    public ResponseInfo insert(@RequestBody ItemClassVO itemClassVO) {
        try {
            iItemClassService.insert(itemClassVO);
            return ResponseInfo.generateSuccessRes();
        } catch (Exception e) {
            return ResponseInfo.generateErrorRes(e.getMessage());
        }
    }
}
